package demo.parallelcore;

import java.util.List;

public class Starting {
    public static void main(String[] args) {
        DataUtilities duh = DataUtilities.getUtilities(); 
        List<Customer> custs = duh.getCustomerList();
        List<Product> product = duh.getProductList();
        List<Supplier> supply = duh.getSupplierList();
        
        printCust(custs);
        printProd(product);
        printSupp(supply);
        
    }
    
    public static void printCust(List<Customer> foo ){
        System.out.flush();
        System.out.println();
        System.out.println("Customers");        
        foo.forEach(x -> System.out.println(x.getCustomerID()+ "\t" + x.getPhone()));
        System.out.flush();
    }
    
    public static void printProd(List<Product> foo ){
        System.out.flush();
        System.out.println();
        System.out.println("Products");        
        foo.forEach(x -> System.out.println(x.getProductName()
                                             .concat("                                       ")
                                             .substring(0,38) + 
                                            "\t$" + x.getUnitPrice()));
        System.out.flush();
    }

    public static void printSupp(List<Supplier> foo ){
        System.out.flush();
        System.out.println();
        System.out.println("Suppliers");        
        foo.forEach(x -> System.out.println(x.getSupplierName()
                                             .concat("                                             ")
                                             .substring(0,38) + "\t" + 
                                            x.getAddress()
                                             .concat("                                                       ")
                                             .substring(0,48)
                                            + x.getCity()));
        System.out.flush();
    }
}
